#pragma once

#include <iostream>

#include "hashTable.h"

namespace HashBucket {
template <class K>
class unordered_set {

  struct setKeyOfT {  // 仿函数
    const K& operator()(const K&key) { return key; }
  };

 public:
  typedef typename HashTable<K,K, setKeyOfT>::iterator iterator;
  typedef typename HashTable<K, K, setKeyOfT>::const_iterator const_iterator;

  iterator begin() { return _hsT.begin(); }
  iterator end() { return _hsT.end(); }

  const_iterator begin()const { return _hsT.begin(); }
  const_iterator end()const { return _hsT.end(); }

  std::pair<const_iterator, bool> Insert(const K& key) {
    return _hsT.Insert(key);
  }

    iterator Erase(const K& key) { return _hsT.Erase(key); }

    iterator Find(const K& key) { return _hsT.Find(key); }

   protected:
   private:
    HashTable<K, K, setKeyOfT> _hsT;
};
}  // namespace HashBucket